﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Web.Mvc;

namespace eLoan.Models
{
    [Table("LoanPayment")]
    public class LoanPayment : LoanPaymentFields
    { }

    public class LoanPaymentAddEditModel 
    {
        public string DBCommand { get; set; }

        public IEnumerable<SelectListItem> PaymentTypes { get; set; }

        public LoanPayment LoanPayment { get; set; }
    }

    public class LoanPaymentQueryModel : LoanPaymentFields
    {
        [Display(Name = "Payment Type")]
        [StringLength(100)]
        public string PaymentTypeName { get; set; }
    }

    public class LoanPaymentFields
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        [Display(Name = "ID")]
        public int ID { get; set; }

        [Required]
        [Display(Name = "Document No")]
        [StringLength(50)]
        public string DocumentNo { get; set; }

        [Display(Name = "Payment Type")]
        public int PaymentTypeID { get; set; }

        [Display(Name = "Payment Date")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
        public DateTime PaymentDate { get; set; }

        [Display(Name = "Penalty")]
        public decimal Penalty { get; set; }

        [Display(Name = "Amount")]
        public decimal Amount { get; set; }

        [Display(Name = "Is Void")]
        public bool IsVoid { get; set; }

        [Display(Name = "Void Date")]
        public DateTime? VoidDate { get; set; }

        [Display(Name = "Remarks")]
        [StringLength(100)]
        public string Remarks { get; set; }

        [Display(Name = "Void By")]
        [StringLength(56)]
        public string VoidBy { get; set; }

        [Display(Name = "Payment Status")]
        public int StatusID { get; set; }

        [Display(Name = "Due Remarks")]
        public string DueRemarks{ get; set; }
    }

}